$(function(){
  $.ajax({
    url:'/user/queryUserMessage',
    type:'get',
    success:function(info){
      if(info.error){
        location.href = "login.html";
      }
      $(".user_message").html(template("tmp",info));
    }
  })
  $(".btn_logout").on("click",function(){
    $.ajax({
      url:'/user/logout',
      type:'get',
      success:function(info){
        console.log(info);
        if(info.success){
          location.href = "login.html"; 
        }
      }
    })
  })
})